<template>
	<view class="content">
		<view class="section-1">
			<view class="section-body">
				<view class="list">
					<view class="item" v-for="item in list" :key="item.id">
						<u-image @click="previewImage(item.file_path ? item.file_path.replace(/\\/g,'/') : '')"  width="100%" height="300rpx" class="img-file" mode="aspectFit" :fade="true" duration="300" :src="item.file_path ? item.file_path.replace(/\\/g,'/') : ''" :lazy-load="true">
							<view slot="error" style="font-size: 24rpx;">图片加载失败</view>
						</u-image>
						<view class="remark">描述: {{item.remark}}</view>
					</view>
					<!-- <view class="item" v-for="item in list">
						<view class="project">{{item.project_name}}</view>
						<view class="img">
							<image mode="aspectFill" src="../../../../../../src/imgs/test.jpg"></image>
							<view class="title">{{item.check_content}}</view>
						</view>
						<view class="info">
							<view class="info-item">
								<view class="label">类型</view>
								<view class="value">{{item.check_type == 1 ? '质量问题' : '安全问题'}}</view>
							</view>
							<view class="info-item">
								<view class="label">违章库</view>
								<view class="value">{{item.peccancy_type}}</view>
							</view>
							<view class="info-item">
								<view class="label">责任人</view>
								<view class="value">{{item.zrr_name}}</view>
							</view>
							<view class="info-item">
								<view class="label">罚款</view>
								<view class="value">{{item.fk_money}}</view>
							</view>
						</view>
					</view> -->
				</view>
			</view>
		
		</view>
	</view>
</template>

<script>

	import { towerImgListApi } from '@/api/statistics.js';
	import { mapGetters, mapActions} from 'vuex';
	export default {
		
		data() {
			return {
	
				list: [],
				
			};
		},
		methods:{
			previewImage(url) {
				uni.previewImage({
					urls: [url],
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
							console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				});
			},
			async fetchData() {
				uni.showLoading({title: '加载中...'});
				const { data } = await towerImgListApi({
					project_id: this.project_id,
					type: 1
				});
				uni.hideLoading();
				if (data.code === 1) {
					
					this.list = data.data;
				}
			},
			
		},
		onReady() {
			this.fetchData();
		},
		onLoad(data) {
			this.project_id = data.id
			
		}
	}
</script>

<style lang="scss" scoped>
	.content{
		background-color: #fff;
	}
	.section-1{
		width: 100%;
		background-color: #2e5efe;
		/deep/ .u-fade-enter-active{
			    background-color: rgba(0, 0, 0, 0.65) !important;
		}
		.section-body{
			width: 100%;
			padding-left: 40rpx;
			padding-right: 40rpx;
			padding-bottom: 50rpx;
			background-color: #fff;
			background-size: cover;
			background-repeat: no-repeat;
			border-top-left-radius: 50rpx;
			border-top-right-radius: 50rpx;
			overflow: hidden;
			box-sizing: border-box;
			.list{
				width: 100%;
				padding-top: 20rpx;
				.item{
					box-shadow: 0 0 20rpx 10rpx rgba(#bcbcb5, 0.17);
					border: 1px solid #bcbcb5;
					border-bottom-left-radius: 10px;
					border-bottom-right-radius: 10px;
					width: 100%;
					margin-bottom: 20rpx;
					.remark{
						padding-top: 15rpx;
						padding-bottom: 15rpx;
						line-height: 30rpx;
						padding-left: 10px;
						width: 100%;
						@include font-normal;
					}
				}
			}
		}
	}
</style>
